package top.luoblog.observer.withjdk.pull;

import java.util.Observable;
import java.util.Observer;

/**
 * @author : luo
 * @description : 观察者实现 Observer
 */
public class CounterObserver implements Observer {

    @Override
    public void update(Observable o, Object arg) {
        if (o instanceof CounterObservable) {
            CounterObservable counterObservable = (CounterObservable) o;
            System.out.println(((CounterObservable) o).getCount());
        }
    }
}
